package day06.work04;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;
import java.util.Scanner;

import com.briup.md01.random;

public class Test {
    public static void main(String[] args) {
        Collection<Integer> list1=new ArrayList<>();
        //(1)---------------------------------
        Random random=new Random();
        for(int i=0;i<20;i++){
            int a=random.nextInt(100);
            list1.add(a);
        }
        System.out.print("list1:");
        for(Object object:list1.toArray()){
            System.out.print(object);
            System.out.print(", ");
        }
        System.out.println();

        //(2)(3)-----------------------
        Collection<Integer> list2=new ArrayList<>();
        for(Integer num:list1){
            if(num%2==0){list2.add(num);}            
        }
        //(4)---------------------------------------
        System.out.print("list2:");
        for(Object object:list2.toArray()){
            System.out.print(object);
            System.out.print(", ");
        }
        System.out.println();
    }


}
